<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">
   
        <ui:define name="content">
            <h:outputScript name="jsf.js" library="javax.faces" target="head" />
             
            <h:panelGroup id="messagePanel" layout="block">
<!--                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>-->
            </h:panelGroup>
            <h:form>
                <p:panel toggleable="true" id="salesForecastUpdate" header=" #{salesForecastEntityController.selected.yearOfSales} #{salesForecastEntityController.selected.monthOfSales} Sales Forecast Update">
                <h:panelGrid columns="2">
                      
                    <h:outputLabel value="Growth Adjustment (%):" for="monthlyGrowth" />
                    <p:inputText  id="monthlyGrowth" value="#{salesForecastEntityController.selected.monthlyGrowthAdjustment}" />
                    
                    <h:outputLabel value="Future Promotion (Shipping Cases):" for="futurePromotion" />
                    <p:inputText  id="futurePromotion"  value="#{salesForecastEntityController.selected.expectedMonthlyPromo}" />
                    
                    <h:outputLabel value="Base Projection (Shipping Cases):" for="baseProjection" />
                    <p:inputText  id="baseProjection" disabled="true" value="#{salesForecastEntityController.selected.baseProjection}" />
             
                                 
                    <h:outputLabel value="Forecasted Quantity (Shipping Cases):" for="forecastedQuantity" />
                    <p:inputText  id="forecastedQuantity" disabled="true" value="#{salesForecastEntityController.selected.forecast}" />
                    
                    
                    

                </h:panelGrid>
                     <br/>
                    <p:commandButton value="Short Term Trend" update="display" oncomplete="shortTermTrendDialog.show()"/>
                
                <p:dialog header="Short Term Trend" widgetVar="shortTermTrendDialog" resizable="false"  
                                  width="520" showEffect="explode" hideEffect="explode">  
                    
                    <p:lineChart model="#{salesForecastEntityController.monthlyTrends}" minY="2000" titleX="Month" titleY="Sales"  >  
                   
                    </p:lineChart>  
               
                </p:dialog>
                </p:panel>
                     <br/>
                    
                 
                 <h:commandButton value="Calculate" action="#{salesForecastEntityController.updateForecast}" />
                 
                 <h:commandButton value="Back" action="View"/>
               
              
                    
            </h:form>
        </ui:define>
    </ui:composition>

</html>
